package com.decent.manager.task;

import com.decent.manager.task.service.GoodsStockTaskService;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * 库存同步
 * @author: decent Gjh
 * @date: 2022/10/28/15:30
 * @description:
 */
@Component
public class GoodsStockTask {
    private final GoodsStockTaskService goodsStockTaskService;

    public GoodsStockTask(GoodsStockTaskService goodsStockTaskService) {
        this.goodsStockTaskService = goodsStockTaskService;
    }

    /**
     * 定时库存同步
     */
    @Scheduled(cron = "0 0/5 * * * ? ")
    public void synchronizeInventory(){
        goodsStockTaskService.goodsStockSynchronized();
    }
}
